﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using POSSystem.DAL;

namespace POSSystem.BLL
{
    public class View_CustomerRequests : _View_CustomerRequests
    {
        public static View_CustomerRequests LoadPreviewRequests()
        {
            try
            {
                View_CustomerRequests r = new View_CustomerRequests();
                r.Query.AddResultColumn(View_CustomerRequests.ColumnNames.ID);
                r.Query.AddResultColumn(View_CustomerRequests.ColumnNames.Title);
                r.Query.AddResultColumn(View_CustomerRequests.ColumnNames.Requestor);
                r.Query.AddResultColumn(View_CustomerRequests.ColumnNames.AttachedFiles);
                r.Query.AddResultColumn(View_CustomerRequests.ColumnNames.CreatedDate);
                r.Query.AddOrderBy(View_CustomerRequests.ColumnNames.CreatedDate, MyGeneration.dOOdads.WhereParameter.Dir.DESC);
                r.Query.Load();

                return r;
            }
            catch (Exception ex)
            {
                ErrorLog.WriteToFile("View_CustomerRequests.cs", "LoadPreviewRequests", ex.StackTrace);
                throw ex;
            }
        }
    }
}
